Optimal. Leaf size=71 \[ -\frac{2 \left (a^2+b^2\right ) \cos (e+f x)}{3 f}-\frac{\cos (e+f x) (a+b \sin (e+f x))^2}{3 f}-\frac{a b \sin (e+f x) \cos (e+f x)}{3 f}+a b x \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.048996, antiderivative size = 71, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.105, Rules used = {2753, 2734} \[ -\frac{2 \left (a^2+b^2\right ) \cos (e+f x)}{3 f}-\frac{\cos (e+f x) (a+b \sin (e+f x))^2}{3 f}-\frac{a b \sin (e+f x) \cos (e+f x)}{3 f}+a b x \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2753
Rule 2734
Rubi steps
\begin{align*} \int \sin (e+f x) (a+b \sin (e+f x))^2 \, dx &=-\frac{\cos (e+f x) (a+b \sin (e+f x))^2}{3 f}+\frac{1}{3} \int (2 b+2 a \sin (e+f x)) (a+b \sin (e+f x)) \, dx\\ &=a b x-\frac{2 \left (a^2+b^2\right ) \cos (e+f x)}{3 f}-\frac{a b \cos (e+f x) \sin (e+f x)}{3 f}-\frac{\cos (e+f x) (a+b \sin (e+f x))^2}{3 f}\\ \end{align*}
Mathematica [A] time = 0.210484, size = 59, normalized size = 0.83 \[ \frac{b (12 a (e+f x)-6 a \sin (2 (e+f x))+b \cos (3 (e+f x)))-3 \left (4 a^2+3 b^2\right ) \cos (e+f x)}{12 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.019, size = 64, normalized size = 0.9 \begin{align*}{\frac{1}{f} \left ( -{\frac{{b}^{2} \left ( 2+ \left ( \sin \left ( fx+e \right ) \right ) ^{2} \right ) \cos \left ( fx+e \right ) }{3}}+2\,ab \left ( -1/2\,\sin \left ( fx+e \right ) \cos \left ( fx+e \right ) +1/2\,fx+e/2 \right ) -\cos \left ( fx+e \right ){a}^{2} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.60699, size = 84, normalized size = 1.18 \begin{align*} \frac{3 \,{\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} a b + 2 \,{\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} b^{2} - 6 \, a^{2} \cos \left (f x + e\right )}{6 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.97532, size = 139, normalized size = 1.96 \begin{align*} \frac{b^{2} \cos \left (f x + e\right )^{3} + 3 \, a b f x - 3 \, a b \cos \left (f x + e\right ) \sin \left (f x + e\right ) - 3 \,{\left (a^{2} + b^{2}\right )} \cos \left (f x + e\right )}{3 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 1.03553, size = 107, normalized size = 1.51 \begin{align*} \begin{cases} - \frac{a^{2} \cos{\left (e + f x \right )}}{f} + a b x \sin ^{2}{\left (e + f x \right )} + a b x \cos ^{2}{\left (e + f x \right )} - \frac{a b \sin{\left (e + f x \right )} \cos{\left (e + f x \right )}}{f} - \frac{b^{2} \sin ^{2}{\left (e + f x \right )} \cos{\left (e + f x \right )}}{f} - \frac{2 b^{2} \cos ^{3}{\left (e + f x \right )}}{3 f} & \text{for}\: f \neq 0 \\x \left (a + b \sin{\left (e \right )}\right )^{2} \sin{\left (e \right )} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 2.03036, size = 103, normalized size = 1.45 \begin{align*} a b x + \frac{b^{2} \cos \left (3 \, f x + 3 \, e\right )}{12 \, f} - \frac{b^{2} \cos \left (f x + e\right )}{4 \, f} - \frac{a b \sin \left (2 \, f x + 2 \, e\right )}{2 \, f} - \frac{{\left (2 \, a^{2} + b^{2}\right )} \cos \left (f x + e\right )}{2 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]